<template>
	<view class="main">
		<safe-hight-box background="#F7F7F7"></safe-hight-box>
		<view class="top flex-between" style="align-items: flex-start;">
			<label>购物车(40)</label>
			<label :style="manage?'font-size: 32upx;color: #FF5353;':'font-size: 32upx;'" @click="manage=!manage">管理</label>
		</view>
		<view class="content">
			<van-checkbox-group :value="choose" @change="choose=$event.detail">
				<view class="content-item flex-between">
					<van-checkbox name="a" checked-color="#FBC241"></van-checkbox>
					<image src="https://alipic.lanhuapp.com/xd0cdfd74b-ef97-4ec2-9c91-ddd2bc15bf5e" mode="aspectFill"></image>
					<view class="content-item-info flex-column-around">
						<label class="content-item-info-title">海底捞正宗火锅底料</label>
						<label>500g/袋 特辣</label>
						<view class="flex-between" style="width: 100%;">
							<label class="content-item-info-price">￥120.00</label>
							<van-stepper disable-input="true" />
						</view>
					</view>
				</view>
				<view class="content-item flex-between">
					<van-checkbox name="b" checked-color="#FBC241"></van-checkbox>
					<image src="https://alipic.lanhuapp.com/xd0cdfd74b-ef97-4ec2-9c91-ddd2bc15bf5e" mode="aspectFill"></image>
					<view class="content-item-info flex-column-around">
						<label class="content-item-info-title">海底捞正宗火锅底料</label>
						<label>500g/袋 特辣</label>
						<view class="flex-between" style="width: 100%;">
							<label class="content-item-info-price">￥120.00</label>
							<van-stepper disable-input="true" />
						</view>
					</view>
				</view>
				<view class="content-item flex-between">
					<van-checkbox name="c" checked-color="#FBC241"></van-checkbox>
					<image src="https://alipic.lanhuapp.com/xd0cdfd74b-ef97-4ec2-9c91-ddd2bc15bf5e" mode="aspectFill"></image>
					<view class="content-item-info flex-column-around">
						<label class="content-item-info-title">海底捞正宗火锅底料</label>
						<label>500g/袋 特辣</label>
						<view class="flex-between" style="width: 100%;">
							<label class="content-item-info-price">￥120.00</label>
							<van-stepper disable-input="true" />
						</view>
					</view>
				</view>
			</van-checkbox-group>
		</view>
		<view class="bottom flex-between">
			<label class="flex-between" style="justify-content:flex-start;align-content: center;"><van-switch :checked="chooseAll" @change="clickAll" active-color="#FBC241" /> 全选</label>
			<label class="bottom-sum flex-between" style="justify-content: flex-end">
				<label v-if="!manage">合计</label>
				<label v-if="!manage" class="bottom-sum-price">￥163.00</label>
			</label>
			<button class="bottom-button" style="display: flex;flex-direction: column;justify-content: center;" v-text="manage?'删除':'结算'"></button>
		</view>
	</view>
</template>

<script>
	export default{
		data(){
			return{
				manage:false,
				choose:[],
				chooseAll:false
			}
		},
		methods:{
			clickAll(){
				const that=this;
				that.chooseAll=!that.chooseAll;
			}
		}
	}
</script>
<style>
	page{
		background: #F7F7F7;
	}
</style>
<style lang="scss" scoped>
	.top{
		height: 88upx;
		background: #F7F7F7;
		padding: 32upx;
		font-size: 40upx;
		font-weight: bold;
		color: #666666;	
	}
	.content{
		width: 666upx;
		padding-left: 10upx;
		padding-right: 10upx;
		background: #FFFFFF;
		border-radius: 10upx;
		margin: 0 auto;
		.content-item{
			padding-top: 20upx;
			padding-bottom: 20upx;
			image{
				width: 200upx;
				height: 200upx;
			}
			.content-item-info{
				width: 380rpx;
				height: 200upx;
				font-size: 24upx;
				font-weight: 500;
				color: #666666;
				.content-item-info-title{
					width: 100%;
					font-size: 32upx;
					font-weight: bold;
					color: #333333;
					white-space: nowrap;
					overflow: hidden;
					text-overflow: ellipsis;
				}
				.content-item-info-price{
					font-size: 32upx;
					font-weight: bold;
					color: #FF5353;
				}
			}
		}
	}
	.bottom{
		padding-left: 30upx;
		padding-right: 30upx;
		width: 690upx;
		height: 98upx;
		background: #FFFFFF;
		position: fixed;
		bottom: 0upx;
		font-size: 28upx;
		font-weight: 500;
		color: #666666;
		.bottom-sum{
			width: 320upx;
			text-align: right;
			.bottom-sum-price{
				font-size: 40upx;
				font-weight: bold;
				color: #FF5353;
			}
		}
		.bottom-button{
			width: 148upx;
			height: 56upx;
			background: #FBC241;
			border-radius: 28px;
			font-size: 32upx;
			font-weight: bold;
			color: #FFFFFF;
			text-align: center;
		}
	}
</style>
	.main{
		background-color: #ffffff;
	}
</style>
